<div class="user">
    {% if request.session.user %}
    <a href="/vote/user">
        <img id="photo" src="{{ request.session.user.photo.url }}">
    </a>
    <a href="/vote/logout">注销</a>
    {% else %}
    <a href="/vote/login">登录</a>&nbsp;&nbsp;
    {% endif %}
    <a href="/vote/register">注册</a>
</div>